<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use DateTimeInterface;

abstract class BaseModel extends Model
{
    protected $dateFormat = 'Y-m-d H:i:s';
    // 全局序列化日期格式
    protected function serializeDate(DateTimeInterface $date)
    {
        return $date->format($this->dateFormat);
        
    }

    public function getDateFormat()
    {
        return 'Y-m-d H:i:s';
    }
}